<?php

/**
 * photo actions.
 *
 * @package    sfwixet
 * @subpackage photo
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class privateMessagesComponents extends sfComponents
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeTitle(sfWebRequest $request)
  {
		$this->albumName = $this->getUser()->getGuardUser()->getMainPrivateMessagesDirectory()->getName();
  }
  
  public function executeIndex(sfWebRequest $request)
  {
  		$pager = $this->getUser()->getGuardUser()->getPrivateMessages($request->getParameter("page",1),$request->getParameter("size",10),$request->getParameter("directory",$this->getUser()->getGuardUser()->getMainPrivateMessagesDirectoryId()));
	  	$results = $pager->getResults();
	  	
	  	$this->total = $pager->getLastPage();
		$this->messages = $pager->getResults();
		$this->userId = $this->getUser()->getId();
  }
}
